Fillet Polyline
===============

.. image:: https://user-images.githubusercontent.com/14288520/205455605-5ad1a25c-765f-4166-bd68-36f94e7babb8.png
  :target: https://user-images.githubusercontent.com/14288520/205455605-5ad1a25c-765f-4166-bd68-36f94e7babb8.png

Functionality
-------------

This node generates a filleted polyline curve, i.e. a curve consisting of
segments of straight lines and circular arcs to connect them. The curve may be
closed or not.

.. image:: https://user-images.githubusercontent.com/14288520/205455719-299f0aaf-444e-4dfc-9794-921bbd0d5105.png
  :target: https://user-images.githubusercontent.com/14288520/205455719-299f0aaf-444e-4dfc-9794-921bbd0d5105.png

The curve is generated by plotting a polyline through the points, and then
rounding all corners by replacing them with circular arc.

Instead of circular arcs, the node can generate segments of quadratic Bezier
curves. This option can be useful, for example, if one of nodes applied later
can not handle rational NURBS curves.

Curve domain / parametrization specifics: depends on **Even domains**
parameter. If checked, then each straight segment, as well as each arc, will be
given a domain of length 1.0; so the total domain of the curve will be equal to
number of all segments - straight and circular. If not checked, then each
straight segment will be given a domain equal to segment's lengths, and each
arc will be given a domain equal to it's angle.

Inputs
------

This node has the following input:

* **Vertices**. The points controlling the curve; the polyline will go through
  these points, and then will be filleted. This input is mandatory.

.. image:: https://user-images.githubusercontent.com/14288520/205456098-06b12f21-2275-462f-81a0-44477a08965d.png
  :target: https://user-images.githubusercontent.com/14288520/205456098-06b12f21-2275-462f-81a0-44477a08965d.png

* **Radius**. Fillet arc radius. This input can be provided with separate
  radius for each control point. The default value is 0.2.

.. image:: https://user-images.githubusercontent.com/14288520/205459667-20060194-736f-49ce-a405-f1b66157bcea.png
  :target: https://user-images.githubusercontent.com/14288520/205459667-20060194-736f-49ce-a405-f1b66157bcea.png

Parameters
----------

This node has the following parameters:

* **Fillet mode**. This defines the type of curve to be used for fillets. The available options are:

  * **Circular arc**.
  * **Quadratic Bezier arc**.

  The default option is **Circular arc**.

.. image:: https://user-images.githubusercontent.com/14288520/205456797-bd7b07d8-296d-413c-8efd-e5e6553797c8.gif
  :target: https://user-images.githubusercontent.com/14288520/205456797-bd7b07d8-296d-413c-8efd-e5e6553797c8.gif

* **Concatenate**. If checked, then all straight and arc segments will be
  concatenated into a single curve. Otherwise, each segment will be output as a
  separate curve object. Checked by default.

.. image:: https://user-images.githubusercontent.com/14288520/205457222-f0c6e20f-c877-405d-a7aa-6845bb8dc13f.png
  :target: https://user-images.githubusercontent.com/14288520/205457222-f0c6e20f-c877-405d-a7aa-6845bb8dc13f.png

* **Even domains**. If checked, give each segment a domain of length 1. This
  parameter is only available if **Concatenate** parameter is checked.
  Unchecked by default.

.. image:: https://user-images.githubusercontent.com/14288520/205458369-33bab885-1ba1-437f-b1d9-85b7e3fbc057.png
  :target: https://user-images.githubusercontent.com/14288520/205458369-33bab885-1ba1-437f-b1d9-85b7e3fbc057.png

* **Cyclic**. If checked, the node will generate a cyclic (closed) curve. Unchecked by default.

.. image:: https://user-images.githubusercontent.com/14288520/205458490-ba549327-575a-43e6-a853-760af7eb0f31.gif
  :target: https://user-images.githubusercontent.com/14288520/205458490-ba549327-575a-43e6-a853-760af7eb0f31.gif

* **Clamp**. If checked, fillet will be limited to the maximum radius

.. image:: https://user-images.githubusercontent.com/14288520/205458563-804852ae-a9fd-4ff9-8310-6f7ab36428b5.gif
  :target: https://user-images.githubusercontent.com/14288520/205458563-804852ae-a9fd-4ff9-8310-6f7ab36428b5.gif

Outputs
-------

This node has the following outputs:

* **Curve**. The generated curve (or curves).
* **Centers**. Centers of circles used to make fillet arcs. These are matrices,
  since this output provides not only centers, but also orientation of the
  circles.

.. image:: https://user-images.githubusercontent.com/14288520/205458744-44119e6f-69fb-401a-87d2-1f36caeb6d6b.png
  :target: https://user-images.githubusercontent.com/14288520/205458744-44119e6f-69fb-401a-87d2-1f36caeb6d6b.png

Examples of usage
-----------------

Filleted polyline through some random points:

.. image:: https://user-images.githubusercontent.com/14288520/205458943-3d2361b1-9159-4daa-8413-3d417faf6023.png
  :target: https://user-images.githubusercontent.com/14288520/205458943-3d2361b1-9159-4daa-8413-3d417faf6023.png

* Generator-> :doc:`Random Vector </nodes/generator/random_vector_mk3>`
* Viz-> :doc:`Viewer Draw Curve </nodes/viz/viewer_draw_curve>`

---------

The same but with **Cyclic** and **Clamp** parameters checked:

.. image:: https://user-images.githubusercontent.com/14288520/205459175-47440954-dffe-41ea-b799-c682629546c6.png
  :target: https://user-images.githubusercontent.com/14288520/205459175-47440954-dffe-41ea-b799-c682629546c6.png

* Generator-> :doc:`Random Vector </nodes/generator/random_vector_mk3>`
* Modifiers->Modifier Make-> :doc:`UV Connection </nodes/modifier_make/uv_connect>`
* Viz-> :doc:`Viewer Draw Curve </nodes/viz/viewer_draw_curve>`
* Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`

---------

The same but with **Even domains** checked:

.. image:: https://user-images.githubusercontent.com/14288520/205459350-7449bf42-75bd-4827-946d-2adcbc526749.png
  :target: https://user-images.githubusercontent.com/14288520/205459350-7449bf42-75bd-4827-946d-2adcbc526749.png

* Generator-> :doc:`Random Vector </nodes/generator/random_vector_mk3>`
* Modifiers->Modifier Make-> :doc:`UV Connection </nodes/modifier_make/uv_connect>`
* Viz-> :doc:`Viewer Draw Curve </nodes/viz/viewer_draw_curve>`
* Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`

In the last case, the number of points at each straight segment and arc segment
is the same, since **Eval Curve** node generates evenly-spaced values of the T
parameter.

